package com.swanclouds.redfish.common.redfish;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.common.redfish.Oem;
import com.swanclouds.model.managers.Oem.BMC.BMCUpdateEthernetInterfaces;
import com.swanclouds.model.managers.builder.BMC.UpdateEthernetInterfacesBuilder;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @author 李文强
 * description
 */

public class EthernetInterfacesUpdate implements BMCUpdateEthernetInterfaces {

    @JsonProperty("InterFaceEnabled")
    private Boolean interFaceEnabled;

    @JsonProperty("SpeedMbps")
    private Integer speedMbps;

    @JsonProperty("AutoNeg")
    private Boolean autoNeg;

    @JsonProperty("FullDuplex")
    private Boolean fullDuplex;

    @JsonProperty("MTUSize")
    private Integer mtuSize;

    @JsonProperty("Oem")
    private Oem oem;

    @JsonProperty("Ipv4Addresses")
    private List<Addresses> ipv4Addresses;

    @JsonProperty("Ipv6Addresses")
    private List<Addresses> ipv6Addresses;

    @JsonProperty("Ipv4StaticAddresses")
    private List<Addresses> ipv4StaticAddresses;

    @JsonProperty("Ipv6StaticAddresses")
    private List<Addresses> ipv6StaticAddresses;

    @JsonProperty("Vlan")
    private Vlan vlan;

    @JsonProperty("Ipv6DefaultGateway")
    private String ipv6DefaultGateway;

    @JsonProperty("Ipv6StateDefaultGateway")
    private String ipv6StateDefaultGateway;

    @JsonProperty("NameServers")
    private String[] nameServers;

    @JsonProperty("staticNameServers")
    private String[] staticNameServers;

    @JsonProperty("HostName")
    private String hostName;

    @JsonProperty("FQDN")
    private String fqdn;

    /*@Override
    public List<Addresses> getIPv4Addresses() {
        return this.ipv4Addresses;
    }*/

    @Override
    public UpdateEthernetInterfacesBuilder toBuilder() {
        return new BMCUpdateEthernetInterfacesConterteBuilder();
    }

    public static UpdateEthernetInterfacesBuilder builder() {
        return new EthernetInterfacesUpdate().toBuilder();
    }

   public static class BMCUpdateEthernetInterfacesConterteBuilder implements  UpdateEthernetInterfacesBuilder{

    EthernetInterfacesUpdate m;

    BMCUpdateEthernetInterfacesConterteBuilder() {
        this(new EthernetInterfacesUpdate());
    }

    BMCUpdateEthernetInterfacesConterteBuilder(EthernetInterfacesUpdate m) {
        this.m = m;
    }

    @Override
    public BMCUpdateEthernetInterfaces build() {
        return m;
    }

    @Override
    public UpdateEthernetInterfacesBuilder from(BMCUpdateEthernetInterfaces in) {
        m = (EthernetInterfacesUpdate) in;
        return this;
    }

       @Override
       public UpdateEthernetInterfacesBuilder InterFaceEnabled(Boolean interFaceEnabled) {
        m.interFaceEnabled = interFaceEnabled;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder SpeedMbps(Integer speedMbps) {
        m.speedMbps = speedMbps;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder AutoNeg(Boolean autoNeg) {
         m.autoNeg = autoNeg;
         return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder FullDuplex(Boolean fullDuplex) {
        m.fullDuplex = fullDuplex;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder MTUSize(Integer mtuSize) {
        m.mtuSize = mtuSize;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder VLAN(Vlan vlan) {
        m.vlan = vlan;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder Oem(Oem oem) {
       m.oem = oem;
       return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder Ipv4Addresses(List<Addresses> ipv4Addresses) {
        m.ipv4Addresses = ipv4Addresses;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder Ipv6Addresses(List<Addresses> ipv6Addresses) {
        m.ipv6Addresses = ipv6Addresses;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder IPv4StaticAddresses(List<Addresses> ipv4StaticAddresses) {
        m.ipv4StaticAddresses = ipv4StaticAddresses;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder IPv6StaticAddresses(List<Addresses> ipv6StaticAddresses) {
        m.ipv6StaticAddresses = ipv6StaticAddresses;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder IPv6DefaultGateway(String ipv6DefaultGateway) {
        m.ipv6DefaultGateway = ipv6DefaultGateway;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder IPv6StateDefaultGateway(String ipv6StateDefaultGateway) {
        m.ipv6StateDefaultGateway = ipv6StateDefaultGateway;
        return this;
       }


       @Override
       public UpdateEthernetInterfacesBuilder NameServers(String[] nameServers) {
        m.nameServers = nameServers;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder StaticNameServices(String[] staticNameServices) {
        m.staticNameServers = staticNameServices;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder HostName(String hostName) {
        m.hostName = hostName;
        return this;
       }

       @Override
       public UpdateEthernetInterfacesBuilder FQDN(String fqdn) {
        m.fqdn = fqdn;
        return this;
       }

       @Override
       public String toString() {
           return "BMCUpdateEthernetInterfacesConterteBuilder{" +
                   "m=" + m +
                   '}';
       }
   }

    @Override
    public String getDataId() {
        return null;
    }

    @Override
    public String getType() {
        return null;
    }

    @Override
    public String getMacaddress() {
        return null;
    }

   /* @Override
    public List<Status> getStatus() {
        return null;
    }*/

    @Override
    public Boolean getInterfaceEnabled() {
        return null;
    }

    @Override
    public List<Status> getStatus() {
        return null;
    }

    @Override
    public Integer getMtuSize() {
        return null;
    }

    @Override
    public String getLinkStatus() {
        return null;
    }

    @Override
    public Integer getMaxIPv6StaticAddresses() {
        return null;
    }

    @Override
    public Map<String, Object> getVlan() {
        return null;
    }

    @Override
    public Map<String, Object> getDHCPv6() {
        return null;
    }

    @Override
    public Map<String, Object> getDHCPv4() {
        return null;
    }

    @Override
    public Map<String, Object> getStatelessAddressAutoConfig() {
        return null;
    }

    @Override
    public List<Addresses> getIPv6Addresses() {
        return null;
    }

    @Override
    public Map<String, Object> getLink() {
        return null;
    }

    @Override
    public Boolean getInterFaceEnabled() {
        return this.interFaceEnabled;
    }

    @Override
    public Integer getSpeedMbps() {
        return this.speedMbps;
    }

    @Override
    public Boolean getAutoNeg() {
        return this.autoNeg;
    }

    @Override
    public Boolean getFullDuplex() {
        return this.fullDuplex;
    }

    @Override
    public Integer getMTUSize() {
        return this.mtuSize;
    }

    /*@Override
    public Vlan getVLAN() {
        return this.vlan;
    }*/

    @Override
    public List<Addresses> getIpv4Addresses() {
        return this.ipv4Addresses;
    }
    @Override
    public List<Addresses> getIPv4StaticAddresses() {
        return this.ipv4StaticAddresses;
    }

    @Override
    public List<Addresses> getIPv6StaticAddresses() {
        return this.ipv6StaticAddresses;
    }

    @Override
    public String getIPv6DefaultGateway() {
        return this.ipv6DefaultGateway;
    }

    @Override
    public String getIPv6StateDefaultGateway() {
        return this.ipv6StateDefaultGateway;
    }

    @Override
    public String[] getNameServers() {
        return new String[0];
    }

    @Override
    public String[] getStaticNameServices() {
        return new String[0];
    }

    @Override
    public String getHostName() {
        return null;
    }

    @Override
    public String getFQDN() {
        return this.fqdn;
    }

    @Override
    public Oem getOem() {
        return this.oem;
    }

    @Override
    public String getId() {
        return null;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public String getPermanentMACAddress() {
        return null;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "EthernetInterfacesUpdate{" +
                "interFaceEnabled=" + interFaceEnabled +
                ", speedMbps=" + speedMbps +
                ", autoNeg=" + autoNeg +
                ", fullDuplex=" + fullDuplex +
                ", mtuSize=" + mtuSize +
                ", oem=" + oem +
                ", ipv4Addresses=" + ipv4Addresses +
                ", ipv6Addresses=" + ipv6Addresses +
                ", ipv4StaticAddresses=" + ipv4StaticAddresses +
                ", ipv6StaticAddresses=" + ipv6StaticAddresses +
                ", vlan=" + vlan +
                ", ipv6DefaultGateway='" + ipv6DefaultGateway + '\'' +
                ", ipv6StateDefaultGateway='" + ipv6StateDefaultGateway + '\'' +
                ", nameServers=" + Arrays.toString(nameServers) +
                ", staticNameServers=" + Arrays.toString(staticNameServers) +
                ", hostName='" + hostName + '\'' +
                ", fqdn='" + fqdn + '\'' +
                '}';
    }
}
